import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect: '/index',
        children: [
            {
                path: '/login',
                component: () => import('../views/LoginView.vue')
            },
            {
                path: '/regis',
                component: () => import('../views/RegisView.vue')
            },
            {
                path: '/index',
                component: () => import('../views/index/IndexView.vue')
            },
            {
                path: '/edit',
                component: () => import('../views/index/EditView.vue'),
                redirect: '/ind',
                children: [
                    {
                        path: '/ind',
                        component: () => import('../views/index/IndexView')
                    }
                ]
            },
            {
                path: '/video',
                component: () => import('../views/index/VideoView.vue')
            },
            {
                path: '/message',
                component: () => import('../views/index/MessageView.vue'),
                redirect:'/my-message',
                children: [
                    {
                        path: '/my-message',
                        component: () => import('../views/index/MessageViewChilerd.vue')
                    }
                ]
            },
            {
                path: '/my',
                component: () => import('../views/index/MyView.vue'),
                redirect:'/my-index',
                children: [
                    {
                        path: '/my-index',
                        component: () => import('../views/index/MyIndexView.vue')
                    }
                ]
            }
        ]
    }
];

const router = new VueRouter({
    routes
})

export default router
